#include <iostream>

using namespace std; 

int fun(int y, int m, int d)
{
	int sum = 0;
	if(y % 4 == 0 && y % 400 == 0 && m > 3) sum++;
	
	int arr[12] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30};
	for(int i = 1; i <= m - 1; i++) sum += arr[i];
	
	return sum + d;
}

void m()
{
	cout << fun(2005, 2, 1) << endl;
	cout << fun(2004, 1, 5) << endl;
	cout << fun(2004, 10, 12) << endl;
	cout << fun(2005, 12, 20) << endl;
	return;
}

int main(void) 
{
	m();	
	
	return 0;
}
